/**
 *
 * Module        : Module Size
 * Authors       : Ben Kwint & Arie van der Veek
 * Date          : November 7th 2011
 * Description   : Detects whether a line is empty. This means that
 *                 a line only contains whitespace, spaces tabs or newlines
 *
 */
module Regular::EmptyLines

import List;

public bool isEmptyLine(str line)
{
  return (/^[ \t]*$/ := line);
}

public int GetEmptyLines(list[str] lines)
{
  int nrOfLines = 0;
  
  int s = size(lines)-1;
  for( n <- [0..s])
  {
    nrOfLines += (isEmptyLine(lines[n])) ? 1 : 0;
  }
  
  return nrOfLines;
}